home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / java.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  10KB  |  315 lines

  1. <?xml version="1.0"?>
  2. <!-- 
  3.  * :tabSize=8:indentSize=8:noTabs=false:
  4.  * :folding=explicit:collapseFolds=1:
  5. -->
  6. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  7.  
  8. <MODE>
  9.     <PROPS>
  10.         <PROPERTY NAME="commentStart" VALUE="/*" />
  11.         <PROPERTY NAME="commentEnd" VALUE="*/" />
  12.         <PROPERTY NAME="lineComment" VALUE="//" />
  13.         <PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
  14.  
  15.         <!-- Auto indent -->
  16.         <PROPERTY NAME="indentOpenBrackets" VALUE="{" />
  17.         <PROPERTY NAME="indentCloseBrackets" VALUE="}" />
  18.         <PROPERTY NAME="unalignedOpenBrackets" VALUE="(" />
  19.         <PROPERTY NAME="unalignedCloseBrackets" VALUE=")" />
  20.         <PROPERTY NAME="indentNextLine"
  21.             VALUE="\s*(((if|while)\s*\(|else\s*|else\s+if\s*\(|for\s*\(.*\))[^{;]*)" />
  22.         <PROPERTY NAME="unindentThisLine"
  23.             VALUE="^.*(default:\s*|case.*:.*)$" />
  24.         <PROPERTY NAME="electricKeys" VALUE=":" />
  25.     </PROPS>
  26.     <RULES IGNORE_CASE="FALSE"
  27.         HIGHLIGHT_DIGITS="TRUE"
  28.         DIGIT_RE="(0[lL]?|[1-9]\d{0,9}(\d{0,9}[lL])?|0[xX]\p{XDigit}{1,8}(\p{XDigit}{0,8}[lL])?|0[0-7]{1,11}([0-7]{0,11}[lL])?|([0-9]+\.[0-9]*|\.[0-9]+)([eE][+-]?[0-9]+)?[fFdD]?|[0-9]+([eE][+-]?[0-9]+[fFdD]?|([eE][+-]?[0-9]+)?[fFdD]))">
  29.  
  30.         <!-- Silly comment -->
  31.         <SEQ TYPE="COMMENT1">/**/</SEQ>
  32.  
  33.         <!-- Javadoc comment -->
  34.         <SPAN TYPE="COMMENT3" DELEGATE="JAVADOC">
  35.             <BEGIN>/**</BEGIN>
  36.             <END>*/</END>
  37.         </SPAN>
  38.  
  39.         <!-- Java comment (C style) -->
  40.         <SPAN TYPE="COMMENT1">
  41.             <BEGIN>/*</BEGIN>
  42.             <END>*/</END>
  43.         </SPAN>
  44.  
  45.         <SPAN TYPE="LITERAL1" DELEGATE="DOUBLEQUOTE_LITERAL" NO_LINE_BREAK="TRUE">
  46.             <BEGIN>"</BEGIN>
  47.             <END>"</END>
  48.         </SPAN>
  49.         <SPAN TYPE="LITERAL3" DELEGATE="SIMPLEQUOTE_LITERAL" NO_LINE_BREAK="TRUE">
  50.             <BEGIN>'</BEGIN>
  51.             <END>'</END>
  52.         </SPAN>
  53.  
  54.         <!-- end of line comment is defined this way rather than using an
  55.         EOL_SPAN because using an EOL_SPAN causes such comments in jsp
  56.         files to highlight incorrectly -->
  57.         <SEQ_REGEXP TYPE="COMMENT2">[/][/](.*?)$</SEQ_REGEXP>
  58.  
  59.         <SEQ TYPE="OPERATOR">=</SEQ>
  60.         <SEQ TYPE="OPERATOR">!</SEQ>
  61.         <SEQ TYPE="OPERATOR">>=</SEQ>
  62.         <SEQ TYPE="OPERATOR"><=</SEQ>
  63.         <SEQ TYPE="OPERATOR">+</SEQ>
  64.         <SEQ TYPE="OPERATOR">-</SEQ>
  65.         
  66.         <!-- division operator is defined this way so that the '//' at the
  67.         start of single line comments within java scriptlets in jsp files 
  68.         are not parsed as operators. -->
  69.         <SEQ_REGEXP TYPE="OPERATOR">/(?![/])</SEQ_REGEXP>
  70.  
  71.         <!-- workaround to stop "*" from being colorized
  72.              in import statements. -->
  73.         <SEQ TYPE="NULL">.*</SEQ>
  74.  
  75.         <SEQ TYPE="OPERATOR">*</SEQ>
  76.         <SEQ TYPE="OPERATOR">></SEQ>
  77.         <SEQ TYPE="OPERATOR"><</SEQ>
  78.         <SEQ TYPE="OPERATOR">%</SEQ>
  79.         <SEQ TYPE="OPERATOR">&</SEQ>
  80.         <SEQ TYPE="OPERATOR">|</SEQ>
  81.         <SEQ TYPE="OPERATOR">^</SEQ>
  82.         <SEQ TYPE="OPERATOR">~</SEQ>
  83.         <SEQ TYPE="OPERATOR">}</SEQ>
  84.         <SEQ TYPE="OPERATOR">{</SEQ>
  85.         <MARK_PREVIOUS TYPE="LABEL" MATCH_TYPE="OPERATOR"
  86.             AT_WHITESPACE_END="TRUE">:</MARK_PREVIOUS>
  87.  
  88.         <!-- Function calls -->
  89.         <MARK_PREVIOUS TYPE="FUNCTION" MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
  90.         <SEQ TYPE="OPERATOR">)</SEQ>
  91.  
  92.         <!-- Annotation types -->
  93.         <MARK_FOLLOWING TYPE="KEYWORD4">@</MARK_FOLLOWING>
  94.  
  95.         <KEYWORDS>
  96.             <!--{{{ modifiers -->
  97.             <KEYWORD1>assert</KEYWORD1>
  98.             <KEYWORD1>break</KEYWORD1>
  99.             <KEYWORD1>case</KEYWORD1>
  100.             <KEYWORD1>catch</KEYWORD1>
  101.             <KEYWORD1>continue</KEYWORD1>
  102.             <KEYWORD1>default</KEYWORD1>
  103.             <KEYWORD1>do</KEYWORD1>
  104.             <KEYWORD1>else</KEYWORD1>
  105.             <KEYWORD1>finally</KEYWORD1>
  106.             <KEYWORD1>for</KEYWORD1>
  107.             <KEYWORD1>if</KEYWORD1>
  108.             <KEYWORD1>instanceof</KEYWORD1>
  109.             <KEYWORD1>new</KEYWORD1>
  110.             <KEYWORD1>return</KEYWORD1>
  111.             <KEYWORD1>strictfp</KEYWORD1>
  112.             <KEYWORD1>switch</KEYWORD1>
  113.             <KEYWORD1>throw</KEYWORD1>
  114.             <KEYWORD1>try</KEYWORD1>
  115.             <KEYWORD1>while</KEYWORD1>
  116.             <!--}}}-->
  117.  
  118.             <!--{{{ structure keywords -->
  119.             <KEYWORD2>final</KEYWORD2>
  120.             <KEYWORD2>implements</KEYWORD2>
  121.             <KEYWORD2>native</KEYWORD2>
  122.             <KEYWORD2>private</KEYWORD2>
  123.             <KEYWORD2>protected</KEYWORD2>
  124.             <KEYWORD2>public</KEYWORD2>
  125.             <KEYWORD2>static</KEYWORD2>
  126.             <KEYWORD2>synchronized</KEYWORD2>
  127.             <KEYWORD2>throws</KEYWORD2>
  128.             <KEYWORD2>transient</KEYWORD2>
  129.             <KEYWORD2>volatile</KEYWORD2>
  130.             <KEYWORD2>abstract</KEYWORD2>
  131.             <KEYWORD2>extends</KEYWORD2>
  132.             <KEYWORD2>import</KEYWORD2> 
  133.             <KEYWORD2>package</KEYWORD2>
  134.             <KEYWORD2>enum</KEYWORD2>
  135.             <KEYWORD3>void</KEYWORD3>
  136.             <!--}}}-->
  137.  
  138.             <!--{{{ types -->
  139.             <KEYWORD3>boolean</KEYWORD3>
  140.             <KEYWORD3>byte</KEYWORD3>
  141.             <KEYWORD3>char</KEYWORD3>
  142.             <KEYWORD3>class</KEYWORD3>
  143.             <KEYWORD3>double</KEYWORD3>
  144.             <KEYWORD3>float</KEYWORD3>
  145.             <KEYWORD3>int</KEYWORD3>
  146.             <KEYWORD3>interface</KEYWORD3>
  147.             <KEYWORD3>long</KEYWORD3>
  148.             <KEYWORD3>short</KEYWORD3>
  149.             <!--}}}-->
  150.  
  151.             <!--{{{ literals -->
  152.             <LITERAL2>false</LITERAL2>
  153.             <LITERAL2>null</LITERAL2>
  154.             <LITERAL2>super</LITERAL2>
  155.             <LITERAL2>this</LITERAL2>
  156.             <LITERAL2>true</LITERAL2>
  157.             <!--}}}-->
  158.  
  159.             <INVALID>goto</INVALID>
  160.             <INVALID>const</INVALID>
  161.         </KEYWORDS>
  162.     </RULES>
  163.  
  164.     <!--{{{ DOUBLEQUOTE_LITERAL rule -->
  165.     <RULES SET="DOUBLEQUOTE_LITERAL" DEFAULT="LITERAL1" IGNORE_CASE="TRUE">
  166.         <SEQ TYPE="LITERAL4">\\</SEQ>
  167.         <SEQ TYPE="LITERAL4">\"</SEQ>
  168.         <SEQ TYPE="LITERAL4">\n</SEQ>
  169.         <SEQ TYPE="LITERAL4">\r</SEQ>
  170.         <SEQ TYPE="LITERAL4">\t</SEQ>
  171.         <SEQ_REGEXP HASH_CHAR="\u" TYPE="LITERAL4">\\u[a-f\d]{4}</SEQ_REGEXP>
  172.     </RULES> <!--}}}-->
  173.     
  174.     <!--{{{ SIMPLEUOTE_LITERAL rule -->
  175.     <RULES SET="SIMPLEQUOTE_LITERAL" DEFAULT="LITERAL3" IGNORE_CASE="TRUE">
  176.         <SEQ TYPE="LITERAL4">\\</SEQ>
  177.         <SEQ TYPE="LITERAL4">\'</SEQ>
  178.         <SEQ TYPE="LITERAL4">\n</SEQ>
  179.         <SEQ TYPE="LITERAL4">\r</SEQ>
  180.         <SEQ TYPE="LITERAL4">\t</SEQ>
  181.         <SEQ_REGEXP HASH_CHAR="\u" TYPE="LITERAL4">\\u[a-f\d]{4}</SEQ_REGEXP>
  182.     </RULES> <!--}}}-->
  183.  
  184.     <!--{{{ JAVADOC rules -->
  185.     <RULES SET="JAVADOC" DEFAULT="COMMENT3" IGNORE_CASE="TRUE">
  186.  
  187.         <!-- so that *@param is highlighted -->
  188.         <SEQ TYPE="COMMENT3">*</SEQ>
  189.  
  190.         <!-- Javadoc ignores tags inside <pre> -->
  191.         <!-- XXX no it doesn't -->
  192.         <!-- SPAN TYPE="MARKUP" DELEGATE="JAVADOC_PRE">
  193.             <BEGIN><pre></BEGIN>
  194.             <END></pre></END>
  195.         </SPAN -->
  196.  
  197.         <!-- HTML comments -->
  198.         <SPAN TYPE="COMMENT1">
  199.             <BEGIN><!--</BEGIN>
  200.             <END>--></END>
  201.         </SPAN>
  202.  
  203.         <!-- Javadoc allows this -->
  204.         <SEQ TYPE="COMMENT3"><<</SEQ>
  205.         <SEQ TYPE="COMMENT3"><=</SEQ>
  206.         <SEQ TYPE="COMMENT3">< </SEQ>
  207.  
  208.         <!-- strings in quotes -->
  209.         <SPAN TYPE="LITERAL1" ESCAPE="\" NO_LINE_BREAK="TRUE">
  210.         <BEGIN>"</BEGIN>
  211.         <END>"</END>
  212.         </SPAN>
  213.  
  214.         <!-- HTML tags -->
  215.         <SPAN TYPE="MARKUP" DELEGATE="xml::TAGS"
  216.             NO_LINE_BREAK="TRUE">
  217.             <BEGIN><</BEGIN>
  218.             <END>></END>
  219.         </SPAN>
  220.  
  221.         <!-- so that @link{...} is highlighted -->
  222.         <!-- XXX: this is wrong, {@link ..} is correct, see below -->
  223.         <!--<SEQ TYPE="COMMENT3">{</SEQ>-->
  224.  
  225.         <SPAN_REGEXP TYPE="LABEL" HASH_CHAR="{@" NO_WORD_BREAK="FALSE" DELEGATE="JAVADOC_PARAM">
  226.             <BEGIN>\{@(link|linkplain|docRoot|code|literal)\s</BEGIN>
  227.             <END>}</END>
  228.         </SPAN_REGEXP>
  229.  
  230.         <!-- for the common usage of the cvs keyword $Id: java.xml 20772 2012-01-13 18:54:27Z kog13 $ -->
  231.         <SPAN_REGEXP TYPE="LABEL" HASH_CHAR="@version" NO_WORD_BREAK="FALSE" DELEGATE="JAVADOC_PARAM">
  232.             <BEGIN>@version\s+\$</BEGIN>
  233.             <END>$</END>
  234.         </SPAN_REGEXP>
  235.  
  236.         <!-- This works only when you use the same whitespace before and after the param's name,
  237.              eg. a tab before and after, but mixing space and tab won't work.
  238.              The reason is that you can't enter a regexp in END, except for the backreference operator $n -->
  239.         <SPAN_REGEXP TYPE="LABEL" HASH_CHAR="@" NO_WORD_BREAK="FALSE" DELEGATE="JAVADOC_PARAM">
  240.             <BEGIN>@(?:param|throws|exception|serialField)(\s)</BEGIN>
  241.             <END>$1</END>
  242.         </SPAN_REGEXP>
  243.  
  244.         <KEYWORDS>
  245.         <!-- Note: the labels in comments are handled by SPANs above -->
  246.  
  247.         <!-- Official javadoc tags:
  248.              http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#javadoctags -->
  249.             <LABEL>@author</LABEL>
  250.             <LABEL>@deprecated</LABEL>
  251.         <!--<LABEL>@docRoot</LABEL>-->
  252.         <!--<LABEL>@exception</LABEL>-->
  253.             <LABEL>{@inheritDoc}</LABEL>
  254.         <!--<LABEL>@link</LABEL>-->
  255.         <!--<LABEL>@linkplain</LABEL>-->
  256.         <!--<LABEL>@param</LABEL>-->
  257.             <LABEL>@return</LABEL>
  258.             <LABEL>@see</LABEL>
  259.             <LABEL>@serial</LABEL>
  260.             <LABEL>@serialData</LABEL>
  261.         <!--<LABEL>@serialField</LABEL>-->
  262.             <LABEL>@since</LABEL>
  263.         <!--<LABEL>@throws</LABEL>-->
  264.             <LABEL>{@value}</LABEL>
  265.             <LABEL>@version</LABEL>
  266.  
  267.         <!-- new in 1.5 -->
  268.         <!--<LABEL>@code</LABEL>-->
  269.         <!--<LABEL>@literal</LABEL>-->
  270.  
  271.         <!-- SUNs proposed tags:
  272.              http://java.sun.com/j2se/javadoc/proposed-tags.html -->
  273.             <KEYWORD2>@category</KEYWORD2>
  274.             <KEYWORD2>@example</KEYWORD2>
  275.             <KEYWORD2>@exclude</KEYWORD2>
  276.             <KEYWORD2>@index</KEYWORD2>
  277.             <KEYWORD2>@internal</KEYWORD2>
  278.             <KEYWORD2>@obsolete</KEYWORD2>
  279.             <KEYWORD2>@threadsafety</KEYWORD2>
  280.             <KEYWORD2>@tutorial</KEYWORD2>
  281.             <KEYWORD2>@todo</KEYWORD2>
  282.  
  283.         <!-- Custom tags -->
  284.             <KEYWORD4>@access</KEYWORD4>
  285.             <KEYWORD4>@beaninfo</KEYWORD4>
  286.             <KEYWORD4>@bon</KEYWORD4>
  287.             <KEYWORD4>@bug</KEYWORD4>
  288.             <KEYWORD4>@complexity</KEYWORD4>
  289.             <KEYWORD4>@design</KEYWORD4>
  290.             <KEYWORD4>@ensures</KEYWORD4>
  291.             <KEYWORD4>@equivalent</KEYWORD4>
  292.             <KEYWORD4>@generates</KEYWORD4>
  293.             <KEYWORD4>@guard</KEYWORD4>
  294.             <KEYWORD4>@hides</KEYWORD4>
  295.             <KEYWORD4>@history</KEYWORD4>
  296.             <KEYWORD4>@idea</KEYWORD4>
  297.             <KEYWORD4>@invariant</KEYWORD4>
  298.             <KEYWORD4>@modifies</KEYWORD4>
  299.             <KEYWORD4>@overrides</KEYWORD4>
  300.             <KEYWORD4>@post</KEYWORD4>
  301.             <KEYWORD4>@pre</KEYWORD4>
  302.             <KEYWORD4>@references</KEYWORD4>
  303.             <KEYWORD4>@requires</KEYWORD4>
  304.             <KEYWORD4>@review</KEYWORD4>
  305.             <KEYWORD4>@spec</KEYWORD4>
  306.             <KEYWORD4>@uses</KEYWORD4>
  307.             <KEYWORD4>@values</KEYWORD4>
  308.         </KEYWORDS>
  309.     </RULES> <!--}}}-->
  310.  
  311.  
  312.     <!-- just a dummy which makes use of the default token type COMMENT4 for highlighting the word after @param in javadoc -->
  313.     <RULES SET="JAVADOC_PARAM" DEFAULT="COMMENT4" IGNORE_CASE="TRUE" />
  314. </MODE>
  315.